__author__ = 'aesop'
#coding:utf-8

from flask import render_template
import libs.weixinApi.gen_wx_oauth2_link as oauth2_link
import config
import time
import libs.util.get_hash as ge_hash
import libs.util.url_encode as url_encode

def note_index_control(app):
    @app.route('/note', methods=['GET'])
    def note_index_qr():
        callback_url = config.host_name + "/note/login/callback"
        state = ge_hash.get_sha1(time.ctime())
        full_url = oauth2_link.baseapi_link(callback_url, state)
        return render_template("pub-notification/index.html",state=state,full_url=full_url)
